package cn.com.w.bootdemo.config;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

//@Component // 想要观察输出顺序，放开此注释
public class CustomConfig {

    public CustomConfig() {
        System.out.println("执行构造方法。");
    }

    @PostConstruct
    public void post() throws Exception {
        System.out.println("执行 post()方法。");
    }

    @PreDestroy
    public void pre() throws Exception {
        System.out.println("执行 pre()方法。");
    }

}
